package com.example.demo.Controller;

import com.example.demo.Dao.ArticalMaper;
import com.example.demo.Model.BlogEntity;
import com.example.demo.Service.CallBackResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class ArticalController {
    @Autowired
    private ArticalMaper articalmaper;

    @RequestMapping(value = "/publisharticles",method = RequestMethod.POST)
    @ResponseBody
    public CallBackResult article(@RequestBody BlogEntity blogEntity){

        boolean issuccess=articalmaper.insertBlog(blogEntity);
        if (issuccess==true){
            return new CallBackResult("发不成功",true,200);
        }
        else
        {
            return new CallBackResult("发布失败",false,500);
        }

    }
}
